Skip to content

Comments

Generated event routing, updated dependencies#181

Merged
alexander-yevsyukov merged 97 commits intomasterfrom
generated-routing
Feb 18, 2025
Merged

Generated event routing, updated dependencies#181
alexander-yevsyukov merged 97 commits intomasterfrom
generated-routing

Conversation

@alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Jan 13, 2025

This PR:

  • Updates local dependencies and adjusts the code to API changes.
  • Introduces the mc-java-routing module which generates Kotlin routing setup classes for tuning EventRouting.

Code generation for other routing schemas will be implemented in the following PRs.

This PR is half-baked to allow current works in Validation to use McJava compatible with the latest versions of ProtoData and CoreJava.

This PR also temporarily disables the integration test project validation-smoke because of API incompatibility introduced by recent CoreJava. The test will be enabled back after Validation is migrated to the latest version of CoreJava and ProtoData.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Jan 13, 2025
@alexander-yevsyukov alexander-yevsyukov changed the title Generated routing Generated event routing, updated dependencies Feb 17, 2025
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review February 17, 2025 19:45
Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, the missing documentation will be added in the consequent PRs. Now, the priority is to push the new API, and expose it for other libraries, such as Validation.

LGTM.

@yevhenii-nadtochii FYI.

import io.spine.server.entity.Entity
import io.spine.server.route.CommandRouting

public interface CommandRoutingSetup<I : Any> :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document.

import io.spine.server.entity.Entity
import io.spine.server.route.EventRouting

public interface EventRoutingSetup<I : Any> :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

import io.spine.server.entity.Entity
import io.spine.server.route.MessageRouting

public interface RoutingSetup<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

import io.spine.server.entity.Entity
import io.spine.server.route.StateUpdateRouting

public interface StateRoutingSetup<I : Any> :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

import io.spine.base.CommandMessage
import io.spine.core.CommandContext

internal class CommandRouteSignature(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document as well.


import com.squareup.kotlinpoet.ksp.toClassName

internal class CommandRouteVisitor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one.

return (!wrongNumber).toErrorCount()
}

internal fun KSFunctionDeclaration.declaringClass(environment: Environment): EntityClass? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one, too.

Comment on lines 114 to 117
Compilation.error(
protoSource, option.span.startLine, option.span.startColumn,
"Unable to find a field with the path `$path` in the type `${type.qualifiedName}`."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already an overload for Span and lambda message.

@alexander-yevsyukov alexander-yevsyukov merged commit 7d3b9f0 into master Feb 18, 2025
7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the generated-routing branch May 17, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants